package com.juxing.webserver.action.common;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.juxing.service.configCenter.bean.ActivityBean;
import com.juxing.service.liveCenter.ILiveCenterService;
import com.juxing.service.liveCenter.bean.LiveBean;
import com.juxing.webserver.action.BaseAction;
import com.juxing.webserver.common.ConfigHelper;

/**
 * 活动页
 * @author brochen
 * @mail mongibello@163.com
 * @created 2016年2月17日
 *
 */
@Controller
@RequestMapping("common/activity")
public class ActivityAction extends BaseAction {
	
	@Autowired
	private ConfigHelper configHelper;
	@Autowired
	private ILiveCenterService liveCenterService;

	/**
	 * 获取活动列表
	 * @param request
	 * @param response
	 * @param userId
	 * @return
	 */
	@RequestMapping("list.json")
	public ModelAndView list(HttpServletRequest request, HttpServletResponse response
			,@RequestParam int userId		//用户ID
			) {
		List<ActivityBean> list = configHelper.queryActivity();
		ModelAndView view = this.initSuccessView("common/activity/list");
		view.addObject("activityList", list);
		
		return this.encryptedView(request, response, view);
	}
	
}
